﻿<Page x:Class="PasswordProvider.View.WelcomePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:lib="clr-namespace:PasswordProvider.View.Library"
    Title="{Binding DisplayName}"
    ToolTip="{Binding ToolTip}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Margin="5,5,5,0" Grid.Row="0" HorizontalAlignment="Stretch">
            <TextBlock Text="{Binding Heading, Mode=OneWay}" TextWrapping="Wrap" />
            <StackPanel Margin="10,5">
                <TextBlock Margin="-10,5,0,3">Create new file and</TextBlock>
                <lib:BindableRadioButton Visibility="{Binding UseDefaultLocation.Visibility}"
                             Content="{Binding UseDefaultLocation.DisplayName}"
                             ToolTip="{Binding UseDefaultLocation.ToolTip}"
                             IsChecked="{Binding UseDefaultLocation.IsChecked, Mode=TwoWay}"
                             />
                <lib:BindableRadioButton Visibility="{Binding ChooseOwnLocation.Visibility}"
                             Content="{Binding ChooseOwnLocation.DisplayName}"
                             ToolTip="{Binding ChooseOwnLocation.ToolTip}"
                             IsChecked="{Binding ChooseOwnLocation.IsChecked, Mode=TwoWay}"
                             />
                <TextBlock Margin="-10,5,0,3">Or,</TextBlock>
                <lib:BindableRadioButton Visibility="{Binding OpenExistingFile.Visibility}"
                             Content="{Binding OpenExistingFile.DisplayName}"
                             ToolTip="{Binding OpenExistingFile.ToolTip}"
                             IsChecked="{Binding OpenExistingFile.IsChecked, Mode=TwoWay}"
                             />
                <lib:BindableRadioButton Visibility="{Binding RestoreFromBackup.Visibility}"
                             Content="{Binding RestoreFromBackup.DisplayName}"
                             ToolTip="{Binding RestoreFromBackup.ToolTip}"
                             IsChecked="{Binding RestoreFromBackup.IsChecked, Mode=TwoWay}"
                             />
                <lib:BindableRadioButton Visibility="{Binding OpenDefaultLocation.Visibility}"
                             Content="{Binding OpenDefaultLocation.DisplayName}"
                             ToolTip="{Binding OpenDefaultLocation.ToolTip}"
                             IsChecked="{Binding OpenDefaultLocation.IsChecked, Mode=TwoWay}"
                             />
            </StackPanel>
            <TextBlock Margin="0,3,0,0" HorizontalAlignment="Left"
                       Text="{Binding FilePath.DisplayName}"
                       />
            <TextBox IsEnabled="{Binding FilePath.IsEnabled}"
                     Text="{Binding FilePath.Text}"
                     />
            <Button Margin="0,5,0,0" HorizontalAlignment="Right"
                    IsEnabled="{Binding BrowseCommand.IsEnabled}"
                    Content="{Binding BrowseCommand.DisplayName}"
                    ToolTip="{Binding BrowseCommand.ToolTip}"
                    Command="{Binding BrowseCommand.Command}"
                    />
        </StackPanel>
        
        <Button Grid.Row="2" Margin="5,0,65,5" HorizontalAlignment="Left" VerticalAlignment="Bottom"
                ToolTip="{Binding ShowHelpCommand.ToolTip}"
                Content="{Binding ShowHelpCommand.DisplayName}"
                Command="{Binding ShowHelpCommand.Command}"
                />

        <Button Grid.Row="2" Width="50" Margin="5,0,5,5" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                IsDefault="True"
                Content="{Binding OkCommand.DisplayName}"
                Command="{Binding OkCommand.Command}"
                />
    </Grid>
</Page>
